import { Component, OnInit } from '@angular/core';
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
import { DataService } from '../../../services/data.service';

@Component({
  selector: 'social-detail',
  templateUrl: './detail.component.html',
  styleUrls: ['./detail.component.scss']
})
export class SocialDetailComponent implements OnInit {

    public operate = "edit";

    public isNew = this.dataService.dashboard;
    
    constructor(
      private route: ActivatedRoute,
      private dataService: DataService//构造dataService
    ) {
      this.route.params.subscribe((data) => {
        this.operate = data.operate;
      });
    }

    ngOnInit() {
      this.route.params.subscribe((data:any) => {
        this.operate = data.operate;
      });

    }

}
